Optimal. Leaf size=98 \[ \frac {(3 B-2 C) x}{2 a}-\frac {2 (B-C) \sin (c+d x)}{a d}+\frac {(3 B-2 C) \cos (c+d x) \sin (c+d x)}{2 a d}-\frac {(B-C) \cos (c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.16, antiderivative size = 98, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {4157, 4105,
3872, 2715, 8, 2717} \begin {gather*} -\frac {2 (B-C) \sin (c+d x)}{a d}+\frac {(3 B-2 C) \sin (c+d x) \cos (c+d x)}{2 a d}-\frac {(B-C) \sin (c+d x) \cos (c+d x)}{d (a \sec (c+d x)+a)}+\frac {x (3 B-2 C)}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2715
Rule 2717
Rule 3872
Rule 4105
Rule 4157
Rubi steps
\begin {align*} \int \frac {\cos ^3(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx &=\int \frac {\cos ^2(c+d x) (B+C \sec (c+d x))}{a+a \sec (c+d x)} \, dx\\ &=-\frac {(B-C) \cos (c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}+\frac {\int \cos ^2(c+d x) (a (3 B-2 C)-2 a (B-C) \sec (c+d x)) \, dx}{a^2}\\ &=-\frac {(B-C) \cos (c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}+\frac {(3 B-2 C) \int \cos ^2(c+d x) \, dx}{a}-\frac {(2 (B-C)) \int \cos (c+d x) \, dx}{a}\\ &=-\frac {2 (B-C) \sin (c+d x)}{a d}+\frac {(3 B-2 C) \cos (c+d x) \sin (c+d x)}{2 a d}-\frac {(B-C) \cos (c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}+\frac {(3 B-2 C) \int 1 \, dx}{2 a}\\ &=\frac {(3 B-2 C) x}{2 a}-\frac {2 (B-C) \sin (c+d x)}{a d}+\frac {(3 B-2 C) \cos (c+d x) \sin (c+d x)}{2 a d}-\frac {(B-C) \cos (c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(197\) vs. \(2(98)=196\).
time = 0.45, size = 197, normalized size = 2.01 \begin {gather*} \frac {\cos \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {c}{2}\right ) \left (4 (3 B-2 C) d x \cos \left (\frac {d x}{2}\right )+4 (3 B-2 C) d x \cos \left (c+\frac {d x}{2}\right )-20 B \sin \left (\frac {d x}{2}\right )+20 C \sin \left (\frac {d x}{2}\right )-4 B \sin \left (c+\frac {d x}{2}\right )+4 C \sin \left (c+\frac {d x}{2}\right )-3 B \sin \left (c+\frac {3 d x}{2}\right )+4 C \sin \left (c+\frac {3 d x}{2}\right )-3 B \sin \left (2 c+\frac {3 d x}{2}\right )+4 C \sin \left (2 c+\frac {3 d x}{2}\right )+B \sin \left (2 c+\frac {5 d x}{2}\right )+B \sin \left (3 c+\frac {5 d x}{2}\right )\right )}{8 a d (1+\cos (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.82, size = 100, normalized size = 1.02
method | result | size |
derivativedivides | \(\frac {-B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {2 \left (-\frac {3 B}{2}+C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2 \left (-\frac {B}{2}+C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\left (3 B -2 C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) | \(100\) |
default | \(\frac {-B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {2 \left (-\frac {3 B}{2}+C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2 \left (-\frac {B}{2}+C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\left (3 B -2 C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) | \(100\) |
risch | \(\frac {3 B x}{2 a}-\frac {x C}{a}+\frac {i B \,{\mathrm e}^{i \left (d x +c \right )}}{2 a d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} C}{2 a d}-\frac {i B \,{\mathrm e}^{-i \left (d x +c \right )}}{2 a d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} C}{2 a d}-\frac {2 i B}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {2 i C}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {B \sin \left (2 d x +2 c \right )}{4 a d}\) | \(156\) |
norman | \(\frac {\frac {\left (2 B -3 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}+\frac {\left (3 B -2 C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {\left (5 B -4 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {\left (3 B -2 C \right ) x}{2 a}-\frac {\left (B -2 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {\left (B -C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {\left (3 B -2 C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {\left (3 B -2 C \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}-\frac {\left (5 B -4 C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) | \(239\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 225 vs.
\(2 (94) = 188\).
time = 0.48, size = 225, normalized size = 2.30 \begin {gather*} -\frac {B {\left (\frac {\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {3 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a + \frac {2 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} - \frac {3 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} + C {\left (\frac {2 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {2 \, \sin \left (d x + c\right )}{{\left (a + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.14, size = 81, normalized size = 0.83 \begin {gather*} \frac {{\left (3 \, B - 2 \, C\right )} d x \cos \left (d x + c\right ) + {\left (3 \, B - 2 \, C\right )} d x + {\left (B \cos \left (d x + c\right )^{2} - {\left (B - 2 \, C\right )} \cos \left (d x + c\right ) - 4 \, B + 4 \, C\right )} \sin \left (d x + c\right )}{2 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {B \cos ^{3}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \cos ^{3}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.49, size = 123, normalized size = 1.26 \begin {gather*} \frac {\frac {{\left (d x + c\right )} {\left (3 \, B - 2 \, C\right )}}{a} - \frac {2 \, {\left (B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{a} - \frac {2 \, {\left (3 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2} a}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.14, size = 107, normalized size = 1.09 \begin {gather*} \frac {x\,\left (3\,B-2\,C\right )}{2\,a}-\frac {\left (3\,B-2\,C\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (B-2\,C\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a\right )}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (B-C\right )}{a\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________